﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Win32;

namespace ATMCommonLib
{
    public static class RegCommon
    {
        public static bool GetRegValue(RegistryKey root, string path, string keyName, out RegistryValueKind kind, out object value)
        {
            kind = RegistryValueKind.Unknown;
            value = null;

            try
            {
                RegistryKey key = root.OpenSubKey(path);
                value = key.GetValue(keyName);
                kind = key.GetValueKind(keyName);

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
    }
}
